<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>博客信息列表</title>
    <script type="text/javascript" src="js/jquery-1.12.4.min.js" th:src="@{/js/jquery-1.12.4.min.js}"></script>
    <link href="bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet" th:href="@{/bootstrap-3.3.7-dist/css/bootstrap.min.css}">
    <script src="bootstrap-3.3.7-dist/js/bootstrap.min.js" th:src="@{/bootstrap-3.3.7-dist/js/bootstrap.min.js}"></script>
    <script type="text/javascript">
        $(function() {
        
        })

        function page(n){
            $("#pageNo").val(n);
            $("#searchForm").submit();
            return false;
        }
    </script>
</head>
<body>
<div class="container-fluid"><br>
	<form id="searchForm" action="/admin/cms/blogs/" method="post" class="form-horizontal">
		<input id="pageNo" name="pageNo" type="hidden" th:value="${pageInfo.pageNum}"/>
		<div class="form-group">
			<label for="firstname" class="col-sm-1 control-label">标题：</label>
				<div class="col-sm-2">
   					<input name="title" class="form-control input-sm" placeholder="标题" th:value="${blogs.title}"/>
   				</div>
			<label for="firstname" class="col-sm-1 control-label">博客类型：</label>
				<div class="col-sm-2">
				<select name="typeId" class="form-control">
					<option value="">所有</option>
						<option th:each="blogType:${types}" th:selected="${blogType.id==blogs.typeId}" th:value="${blogType.id}" th:text="${blogType.name}"></option>
					</select>
   				</div>
			<label for="firstname" class="col-sm-1 control-label">博客标签：</label>
				<div class="col-sm-2">
   					<input name="blogLabels" class="form-control input-sm" placeholder="博客标签" th:value="${blogs.blogLabels}"/>
   				</div>
			<button class="btn btn-success btn-sm" type="submit">
				<span class="glyphicon glyphicon-search" aria-hidden="true"></span>
				查询
			</button>
			<a th:href="@{/admin/cms/blogs/form}" class="btn btn-info btn-sm" target="mainFrame">新增</a>
		</div>
	</form>
	<div class="alert alert-info alert-dismissible" role="alert" th:if="${msg!=null}">
	  <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
	  <strong>提示!</strong><span th:text="${msg}"></span>
	</div>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>序号</th>
				<th>标题</th>
				<th>博客类型</th>
				<th>博客标签</th>
				<th>浏览量</th>
				<th>发布时间</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			<tr th:each="blogs,index_no:${pageInfo.list}">
				<td>[[${index_no.index+1+(pageInfo.pageNum-1)*pageInfo.pageSize }]]</td>
				<td>
					[[${blogs.title}]]
				</td>
				<td th:text="${@dictServie.text(blogs.typeId)}">
				</td>
				<td th:text="${blogs.blogLabels}">
				</td>
				<td>
					[[${blogs.lookNum}]]
				</td>
				<td  th:text="${#dates.format(blogs.createTime, 'yyyy-MM-dd HH:mm:ss')}">
					

				</td>
				<td>
    				<a  th:href="@{/admin/cms/blogs/form?id=}+${blogs.id}" href="#">
    					<button class="btn btn-primary btn-xs" ><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
							编辑
						</button>
    				</a>
					<a th:href="@{/admin/cms/blogs/delete?id=}+${blogs.id}" href="#" onclick="return confirm('确认要删除吗？', this.href)">
						<button class="btn btn-danger btn-xs"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
							删除
						</button>
					</a>
				</td>
			</tr>
		</tbody>
	</table>
	
	<!-- 分页条 -->
	  <div class="row" th:include="model :: pageInfo"></div>
</div>
</body>
</html>